import React, { useEffect, useState } from 'react'
import Table from '../../comdy/table/Index'
import instance from '../../axios/instance'
import { useParams } from 'react-router-dom'
import './detail.css'
import Jg from '../../comdy/jg/Index'

function Index() {
    const { id } = useParams()
    const [detailData, setDetailData] = useState({})

    useEffect(() => {
        instance.get('/health/share/knowledgeBase/v1/findDiseaseKnowledge', {
            params: { id: id }
        }).then(res => {
            console.log('resbzId', res)
            if (res.status === 200) {
                setDetailData(res.data.result)
            }
        })
    }, [])
    return (
        <div>
            <Table></Table>
            <Jg></Jg>
            <div className='de'>
                <div>
                    <p>【病理】</p>
                    <p>{detailData.pathology}</p>
                </div>
                <div>
                    <p>【症状】</p>
                    <p>{detailData.symptom}</p>
                </div>
                <div>
                    <p>【宜与忌】</p>
                    <p>{detailData.benefitTaboo}</p>
                </div>
                <div>
                    <p>【西药治疗】</p>
                    <p>{detailData.westernMedicineTreatment}</p>
                </div>
                <div>
                    <p>【中药治疗】</p>
                    <p>{detailData.chineseMedicineTreatment}</p>
                </div>
            </div>
        </div>
    )
}

export default Index
